    /*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package fr.sorbonne.inf1.tp3.model.local;

import fr.sorbonne.inf1.tp3.model.InterfaceApplication;
import fr.sorbonne.inf1.tp3.model.exception.AnnuiteApplicationException;
import fr.sorbonne.inf1.tp3.model.exception.CalculAnnuiteApplicationException;
import fr.sorbonne.inf1.tp3.model.exception.MontantApplicationException;
import fr.sorbonne.inf1.tp3.model.exception.NbAnneesApplicationException;
import fr.sorbonne.inf1.tp3.model.exception.TauxApplicationException;

/**
 * 
 * @author Dubos Romain
 * @author Oukherfellah Riad
 */
public class Application implements InterfaceApplication {
    
    public Application(){
        
    }

    @Override
    public Double calculerAnnuite(Double pMontant, int pNb_annee, Double pTaux) throws fr.sorbonne.inf1.tp3.model.exception.InternalErrorException, AnnuiteApplicationException, MontantApplicationException, TauxApplicationException, NbAnneesApplicationException, CalculAnnuiteApplicationException {
        return Pret.annuites(pMontant, pNb_annee, pTaux);
    }

    @Override
    public Double calculerNbAnnees(Double pMontant, Double pTaux, int pAnnuite) throws fr.sorbonne.inf1.tp3.model.exception.InternalErrorException, AnnuiteApplicationException, MontantApplicationException, TauxApplicationException, NbAnneesApplicationException, CalculAnnuiteApplicationException {
        try {
            return Pret.nbAnnees(pAnnuite, pMontant, pTaux);
        } catch (CalculAnnuiteApplicationException ex) {
            throw new CalculAnnuiteApplicationException();
        }
    }
}
